package com.ruoyi.deal.info.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.deal.info.domain.DealInfo;
import com.ruoyi.deal.info.mapper.DealInfoMapper;
import com.ruoyi.deal.info.service.IDealInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 交易订单信息Service业务层处理
 * 
 * @author zhezhi
 * @date 2022-10-02
 */
@Service
public class DealInfoServiceImpl implements IDealInfoService
{
    @Autowired
    private DealInfoMapper dealInfoMapper;

    /**
     * 查询交易订单信息
     * 
     * @param infoId 交易订单信息主键
     * @return 交易订单信息
     */
    @Override
    public DealInfo selectDealInfoByInfoId(Long infoId)
    {
        return dealInfoMapper.selectDealInfoByInfoId(infoId);
    }

    /**
     * 查询交易订单信息列表
     * 
     * @param dealInfo 交易订单信息
     * @return 交易订单信息
     */
    @Override
    public List<DealInfo> selectDealInfoList(DealInfo dealInfo)
    {
        return dealInfoMapper.selectDealInfoList(dealInfo);
    }

    /**
     * 新增交易订单信息
     * 
     * @param dealInfo 交易订单信息
     * @return 结果
     */
    @Override
    public int insertDealInfo(DealInfo dealInfo)
    {
        dealInfo.setCreateTime(DateUtils.getNowDate());
        return dealInfoMapper.insertDealInfo(dealInfo);
    }

    /**
     * 修改交易订单信息
     * 
     * @param dealInfo 交易订单信息
     * @return 结果
     */
    @Override
    public int updateDealInfo(DealInfo dealInfo)
    {
        dealInfo.setUpdateTime(DateUtils.getNowDate());
        return dealInfoMapper.updateDealInfo(dealInfo);
    }

    /**
     * 批量删除交易订单信息
     * 
     * @param infoIds 需要删除的交易订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDealInfoByInfoIds(Long[] infoIds)
    {
        return dealInfoMapper.deleteDealInfoByInfoIds(infoIds);
    }

    /**
     * 删除交易订单信息信息
     * 
     * @param infoId 交易订单信息主键
     * @return 结果
     */
    @Override
    public int deleteDealInfoByInfoId(Long infoId)
    {
        return dealInfoMapper.deleteDealInfoByInfoId(infoId);
    }
}
